home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 4490 / 4490.xpi / components / scripts / paran.js < prev    next >
Text File  |  2010-01-19  |  2KB  |  46 lines

  1. /***********************************************************
  2. Paran
  3. ***********************************************************/
  4. var supportInboxOnly=true;
  5.  
  6. function init() {
  7.   var ar=this.user.split("@");
  8.   this.loginData=["https://main.paran.com/mainAction.do?method=paranMainLogin","","wbPasswd","wbUserid="+encodeURIComponent(ar[0])+"&wbDomain="+encodeURIComponent(ar[1])];
  9.   this.dataURL="http://mail.paran.com/";  
  10.   this.mailURL="http://mail.paran.com/";
  11.   this.mailDomain="mail.+?.paran.com";
  12.   if(!this.inboxOnly)this.charSet="utf-8";
  13. }
  14. function getIconURL(){
  15.   return "http://simg.paran.com/paranicon.ico";
  16. }
  17. function process(aHttpChannel, aData){
  18.   switch(this.stage){
  19.     case ST_LOGIN_RES:
  20.       this.getHtml("http://main.paran.com/paran/login_proc.jsp");
  21.       return false;
  22.     case (ST_LOGIN_RES+1):
  23.       this.getHtml("http://mail.paran.com/");
  24.       return false;
  25.     case (ST_LOGIN_RES+2):
  26.       var fnd=aData.match(/location.href=[\'\"](\S+)\/(\S+?)[\'\"]/);
  27.       if(fnd){
  28.         this.dataURL=fnd[1]+(this.inboxOnly?"/read/list.php?p_eye=mail^hom^left^mai^read":"/main/main_list.php?iframe=yes&listgb=all");
  29.         this.mailURL=fnd[1]+"/main/";
  30.       }
  31.       this.stage=ST_DATA;
  32.       break;
  33.   }
  34.   return WebMailHandler.prototype.process.call(this,aHttpChannel, aData);
  35. }
  36.  
  37. function getCount(aData) {
  38.   var fnd;
  39.   if(this.inboxOnly)fnd=aData.match(/\uc548 \uc77d\uc740 \uba54\uc77c.+?(\d+).+?\ud1b5/);
  40.   else fnd=aData.match(/\uc548\uc77d\uc740\uba54\uc77c.+?(\d+)\ud1b5/);
  41.   if(fnd){
  42.     return fnd[1];
  43.   }else{
  44.     return -1;
  45.   }
  46. }